# $Id: PKGBUILD 81119 2012-12-12 00:49:30Z eric $
# Maintainer:  Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Chris Brannon <cmbrannon79@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy@archlinux.org>

pkgname=luarocks
pkgver=2.0.12
pkgrel=2
pkgdesc='Deployment and management system for Lua modules'
arch=('any')
url='http://luarocks.org/'
depends=('lua51' 'unzip' 'zip' 'curl')
optdepends=('cvs: for fetching sources from CVS repositories'
            'git: for fetching sources from git repositories'
            'mercurial: for fetching sources from mercurial repositories'
            'lua51-sec: HTTPS support'
            'cmake: for building rocks that use the cmake build system')
license=('custom')
options=('!makeflags')
source=(http://luarocks.org/releases/$pkgname-$pkgver.tar.gz)
md5sums=('a1bc938ddf835550917f0cb6964ea516')

build() {
  cd $srcdir/$pkgname-$pkgver

  ./configure --prefix=/usr \
              --sysconfdir=/etc/luarocks \
              --with-lua-include=/usr/include/lua5.1/ \
              --with-downloader=curl
  make 
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make install DESTDIR=$pkgdir
  install -D COPYING $pkgdir/usr/share/licenses/$pkgname/LICENSE
}
